home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / psion / viewpica.lha / VIEWPIC.ASC < prev    next >
Text File  |  1994-10-03  |  1KB  |  78 lines

  1. ' FILESELECT "Choose Pic-File...","View","xh1:psion/pic/",file$
  2. file$=_dosCmd$
  3. IF EXIST(file$)=FALSE AND file$<>""
  4.   STOP
  5. ENDIF
  6. OPEN "i",#1,file$
  7. SEEK #1,6 !nr of bitmaps
  8. bm%=INP(1)
  9. grey!=FALSE
  10. IF bm%=2
  11.   grey!=TRUE
  12. ENDIF
  13. SEEK #1,10 !width..
  14. a1%=INP(1)
  15. a2%=INP(1)
  16. w&=a2%*256+a1%
  17. a1%=INP(1)
  18. a2%=INP(1)
  19. h&=a2%*256+a1%
  20. a1%=INP(1)
  21. a2%=INP(1)
  22. si&=a2%*256+a1%
  23. OPENW #1,10,10,w&+24,h&+25,512+8,14
  24. ON MESSAGE GOSUB cleanup
  25. a1%=INSTR(file$,":")
  26. IF a1%>0
  27.   file$=MID$(file$,a1%+1,LEN(file$)-a1%)
  28. ENDIF
  29. a1%=RINSTR(file$,"/")
  30. IF a1%>0
  31.   file$=MID$(file$,a1%+1,LEN(file$)-a1%)
  32. ENDIF
  33. TITLEW #1,STR$(w&)+"*"+STR$(h&)+"*"+STR$(bm%)+" "+file$
  34. SEEK #1,8+12*bm% !bitmap..
  35. IF grey!=TRUE
  36.   SEEK #1,8+12*bm%+si&
  37. ENDIF
  38. DEFFILL 2,1,0
  39. PBOX 10,20,9+w&,19+h&
  40. GRAPHMODE 0
  41. IF INT(w&/8+0.999)/2<>INT(INT(w&/8+0.999)/2)
  42.   ri!=TRUE
  43. ELSE
  44.   ri!=FALSE
  45. ENDIF
  46. FOR g%=1 TO 2
  47.   IF g%=2 OR grey!=FALSE
  48.     COLOR 1
  49.   ELSE
  50.     COLOR 0
  51.   ENDIF
  52.   FOR y%=20 TO h&+19
  53.     FOR x%=1 TO w& STEP 8
  54.       DEFLINE INP(1)*2^8
  55.       LINE 16+x%,y%,8+x%,y%
  56.     NEXT x%
  57.     IF ri!=TRUE
  58.       b%=INP(1)
  59.     ENDIF
  60.   NEXT y%
  61.   IF grey!=FALSE
  62.     g%=3
  63.   ELSE
  64.     SEEK #1,8+12*bm%
  65.   ENDIF
  66. NEXT g%
  67. DO
  68.   SLEEP
  69. LOOP
  70. END
  71. PROCEDURE cleanup
  72.   IF MENU(1)=512
  73.     CLOSE #1
  74.     CLOSEW #1
  75.     STOP
  76.   ENDIF
  77. RETURN
  78.